package com.yswy.app.controller;

import com.yswy.app.dto.AddUserFeedBackVo;
import com.yswy.app.res.SecurityParameter;
import com.yswy.app.service.UserFeedBackService;
import com.yswy.common.model.ResultModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

import static com.yswy.domain.common.util.TokenUtils.getUserId;

@RestController
@RequestMapping("/feed")
@Api(description = "意见反馈")
public class FeedBackController {
    @Autowired
    private UserFeedBackService addUserFeedBack;


    @PostMapping("/addUserFeedBack")
    @ApiOperation(value = "意见反馈")
//    @SecurityParameter()
    public ResultModel addUserFeedBack(  @RequestBody AddUserFeedBackVo addUserFeedBackVo ,
                                            HttpServletRequest request) {
        addUserFeedBack.addUserFeedBack(addUserFeedBackVo.getMsg() , addUserFeedBackVo.getPhone() ,getUserId(request));
        return ResultModel.ok();
    }


}
